package com.elai.operate.service.impl;

import java.util.List;
import com.elai.common.utils.DateUtils;
import com.elai.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.elai.operate.mapper.OperatePushConfigMapper;
import com.elai.operate.domain.OperatePushConfig;
import com.elai.operate.service.IOperatePushConfigService;

/**
 * 推送通道配置Service业务层处理
 * 
 * @author elai
 * @date 2021-10-18
 */
@Service
public class OperatePushConfigServiceImpl implements IOperatePushConfigService 
{
    @Autowired
    private OperatePushConfigMapper operatePushConfigMapper;

    /**
     * 查询推送通道配置
     * 
     * @param id 推送通道配置ID
     * @return 推送通道配置
     */
    @Override
    public OperatePushConfig selectOperatePushConfigById(Integer id)
    {
        return operatePushConfigMapper.selectOperatePushConfigById(id);
    }

    /**
     * 查询推送通道配置列表
     * 
     * @param operatePushConfig 推送通道配置
     * @return 推送通道配置
     */
    @Override
    public List<OperatePushConfig> selectOperatePushConfigList(OperatePushConfig operatePushConfig)
    {
        return operatePushConfigMapper.selectOperatePushConfigList(operatePushConfig);
    }

    /**
     * 新增推送通道配置
     * 
     * @param operatePushConfig 推送通道配置
     * @return 结果
     */
    @Override
    public int insertOperatePushConfig(OperatePushConfig operatePushConfig)
    {
        operatePushConfig.setCreateBy(SecurityUtils.getUsername());
        operatePushConfig.setCreateTime(DateUtils.getNowDate());
        return operatePushConfigMapper.insertOperatePushConfig(operatePushConfig);
    }

    /**
     * 修改推送通道配置
     * 
     * @param operatePushConfig 推送通道配置
     * @return 结果
     */
    @Override
    public int updateOperatePushConfig(OperatePushConfig operatePushConfig)
    {
        operatePushConfig.setUpdateBy(SecurityUtils.getUsername());
        operatePushConfig.setUpdateTime(DateUtils.getNowDate());
        return operatePushConfigMapper.updateOperatePushConfig(operatePushConfig);
    }

    /**
     * 批量删除推送通道配置
     * 
     * @param ids 需要删除的推送通道配置ID
     * @return 结果
     */
    @Override
    public int deleteOperatePushConfigByIds(Integer[] ids)
    {
        return operatePushConfigMapper.deleteOperatePushConfigByIds(ids);
    }

    /**
     * 删除推送通道配置信息
     * 
     * @param id 推送通道配置ID
     * @return 结果
     */
    @Override
    public int deleteOperatePushConfigById(Integer id)
    {
        return operatePushConfigMapper.deleteOperatePushConfigById(id);
    }
}
